#include "global_avg_pool_n_d.h"

using namespace GlobalAvgPool;

extern "C" __global__ __aicore__ void global_avg_pool(GM_ADDR x, GM_ADDR y, GM_ADDR workspace, GM_ADDR tiling) {
    GET_TILING_DATA(tilingData, tiling);

    if (TILING_KEY_IS(101)) {
        GlobalAvgPoolND<float> op;
        op.Init(x, y, &tilingData);
        op.Process();
    } else if (TILING_KEY_IS(201)) {
        GlobalAvgPoolND<half> op;
        op.Init(x, y, &tilingData);
        op.Process();
    }
}